﻿Imports System.Security
Imports System.Security.Principal.WindowsIdentity

Public Class Term_Condizioni
    Dim a As Byte = 0
    Private Sub cmd_non_accetto_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmd_non_accetto.Click
        Application.Exit()
    End Sub

    Private Sub Cmd_accetto_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cmd_accetto.Click
        On Error Resume Next
        My.Settings.Nome_pc = My.Computer.Name
        My.Settings.Nome_utente = GetCurrent.Name
        My.Settings.os = My.Computer.Info.OSFullName
        My.Settings.Data_Ora = My.Computer.Clock.LocalTime.ToString
        MainForm.txt_Nome_pc.Text = My.Settings.Nome_pc
        MainForm.txt_Nome_utente.Text = My.Settings.Nome_utente
        MainForm.txt_os.Text = My.Settings.os
        MainForm.txt_ora.Text = My.Settings.Data_Ora
        System.IO.File.WriteAllLines(Application.StartupPath & "\Magic_Numbers.txt", SubForm_Magic_Numers.magic_num)
        MainForm.Enabled = True
        SubForm_Magic_Numers.Enabled = True
        a = 1
        Me.Close()
    End Sub

    Private Sub Term_Condizioni_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        If a <> 1 Then Application.Exit()
    End Sub
End Class